package com.ksyun.cloudhostalarmprocessing.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

/**
 * <p>
 * 
 * </p>
 *
 * @author 李厚航
 * @since 2024-05-07
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("metrics")
@ApiModel(value = "Metrics对象", description = "")
public class Metrics implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("指标id")
    @TableId(value = "metric_id", type = IdType.ASSIGN_ID)
    private Long metricId;

    @ApiModelProperty("指标名称")
    @TableField("metric_name")
    private String metricName;

    @ApiModelProperty("主机id")
    @TableField("instanceId")
    private String instanceId;

    @ApiModelProperty("时间")
    @TableField("timestamp")
    private LocalDateTime timestamp;

    @ApiModelProperty("指标值")
    @TableField("value")
    private Float value;

    @ApiModelProperty("主机名称")
    @TableField("hostname")
    private String hostname;

    public Metrics(String metricName, String instanceId, LocalDateTime timestamp, Float value, String hostname) {
        this.metricName = metricName;
        this.instanceId = instanceId;
        this.timestamp = timestamp;
        this.value = value;
        this.hostname = hostname;
    }
}
